package app.util.algo;

import framework.task.TaskAssignAlgo;
import framework.agent.CustomAgent;
import framework.task.Task;

import java.util.List;

/**
 * @Name: TaskAssign1
 * @Description: 一一对应分配任务
 * @Author: colfish
 * @Date: 2021/5/13 22:18
 * 好好学习，天天向上！
 */
public class DirectTA implements TaskAssignAlgo<CustomAgent> {

    @Override
    public void TaskAssign(List<CustomAgent> agents, List<Task> tasks) {
        for (int i = 0; i < agents.size(); i++) {
            agents.get(i).takeTask(tasks.get(i));
            tasks.get(i).setAgent(agents.get(i));
            tasks.get(i).doTask();
        }
    }
}
